﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Collection
{
    internal class DictionaryDemo
    {
        static void Main(string[] args)
        {
            Dictionary<int, string> dic = new Dictionary<int, string>();
            dic.Add(1, "a");
            dic.Add(2, "b");
            dic.Add(3, "c");
            dic.Add(4, "d");
            //系统会报错，不能添加相同键
            //dic.Add(1, "e");
            dic[1] = "e";
            dic[6] = "f";
            dic.Remove(1);
            
            foreach (var item in dic)
            {
                Console.WriteLine(item.Value);
            }   
        }
        
        
    }
}
